package com.easyaop.asm.bytecode.asm;

import org.objectweb.asm.MethodVisitor;

import java.util.LinkedList;
import java.util.List;

public class MethodVisitorWriteTry extends MethodVisitor {
    List<TryVo> trys =new LinkedList<>();

    protected MethodVisitorWriteTry(int api, MethodVisitor methodVisitor) {
        super(api, methodVisitor);
    }

    @Override
    public void visitMaxs(int maxStack, int maxLocals) {
//        System.out.println(121221121);
        for (TryVo tryVo : trys) {
            super.visitTryCatchBlock(tryVo.label1, tryVo.label2, tryVo.label3, tryVo.type);
        }
        super.visitMaxs(maxStack, maxLocals);
    }

}
